import type { VbenFormSchema } from '#/adapter/form'
import { $t } from '@vben/locales'

export function getAddEditFormSchema() {
    return [
        {
            fieldName: 'name',
            label: $t('page.system.children.role.children.form.name'),
            defaultValue: '',
            component: 'Input'
        },
        {
            fieldName: 'code',
            label: $t('page.system.children.role.children.form.code'),
            component: 'Input',
            defaultValue: '',
            rules: 'required'
        },
        {
            fieldName: 'note',
            label: $t('page.system.children.role.children.form.note'),
            component: 'Textarea',
            componentProps: {
                rows: 4
            },
            defaultValue: '',
            rules: 'required',
            formItemClass: 'col-span-1'
        },
        {
            fieldName: 'sort',
            label: $t('page.orderFormFiled.children.sort'),
            component: 'InputNumber',
            defaultValue: '',
            rules: 'required',
            componentProps: {
                class: 'w-full',
                min: 0
            }
        },
        {
            label: $t('page.orderFormFiled.children.status'),
            fieldName: 'status',
            component: 'Switch',
            defaultValue: 1,
            componentProps: {
                checkedValue: 1,
                unCheckedValue: 2,
                checkedChildren: $t('options.status.children.normal'),
                unCheckedChildren: $t('options.status.children.disabled')
            }
        }
    ] as VbenFormSchema[]
}
